/* 
 * File:   ActivityManager.cpp
 * Author: bd
 * 
 * Created on March 26, 2011, 10:50 PM
 */

#include <vector>
#include <utility>
#include <sstream>

#include "ActivityManager.hpp"
#include "DeliveryActivity.hpp"
#include "ControllerActivity.hpp"

ActivityManager::ActivityManager()
{
}

ActivityManager::ActivityManager(const ActivityManager& orig)
{
}

ActivityManager::~ActivityManager()
{
}

std::vector<DeliveryActivity::DeliveryActivityPtr> ActivityManager::deliveryActivities(const Configuration& config, Pool<ShortMsgItem>& pool)
{
    std::vector<DeliveryActivity::DeliveryActivityPtr> vec;
    int n = config.numOfDeliveryActivities();
    for (int i = 0; i < n; i++)
    {
        std::ostringstream s;
        s << "Delivery" << "-" << i;
        DeliveryActivity::DeliveryActivityPtr p(new DeliveryActivity(s.str(), config, pool));
        vec.push_back(p);
    }
    return vec;
}

std::vector<ControllerActivity::ControllerActivityPtr> ActivityManager::controllerActivities(const Configuration& config, Pool<ShortMsgItem>& pool)
{
    std::vector<ControllerActivity::ControllerActivityPtr> vec;
    int n = config.numOfControllerActivities();
    for (int i = 0; i < n; i++)
    {
        std::ostringstream s;
        s << "Controller" << "-" << i;

        ControllerActivity::ControllerActivityPtr p(new ControllerActivity(s.str(), config, pool));
        vec.push_back(p);
    }
    return vec;
}